// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-6

#ifndef __JSOCKET_H_COMMON_BASE__
#define __JSOCKET_H_COMMON_BASE__

#pragma once

#include "sockbase.h"

//##ModelId=44C4B5F70246
enum JoySocketState
{
	//##ModelId=44C4B5F70252
    JSS_None,
	//##ModelId=44C4B5F70253
    JSS_Connecting,
	//##ModelId=44C4B5F70254
    JSS_Connected,
};

//##ModelId=44C4B5F70261
class CJoySocket : public CJoySockBase
{
public:
	//##ModelId=44C4B5F70285
    typedef CSocket CBaseType;
protected:
	//##ModelId=44C4B5F70272
    JoySocketState      m_state;


	//##ModelId=44C4B5F70276
    virtual void OnConnect(int nErrorCode);
	//##ModelId=44C4B5F70279
    virtual void OnClose();

public:
	//##ModelId=44C4B5F70280
	CJoySocket();
	//##ModelId=44C4B5F70281
	virtual ~CJoySocket();

	//##ModelId=44C4B5F70283
    bool IsConnected() const
    {
        return m_state == JSS_Connected;
    }
};

#endif  // __JSOCKET_H_COMMON_BASE__
